package org.example.Pojo;

import java.time.LocalTime;

public class User implements Comparable<User>{
    private String name;//用户名
    private String password;//用户密码
    private int  score;//用户总分
    private LocalTime localTime;//用户使用时长

    public User(String name, String password) {
        this.name = name;
        this.password = password;
    }

    public User(String name, String password, int score, LocalTime localTime) {
        this.name = name;
        this.password = password;
        this.score = score;
        this.localTime = localTime;
    }

    public String getName() {
        return name;
    }

    public int getScore() {
        return score;
    }

    public LocalTime getLocalTime() {
        return localTime;
    }

    public String getPassword() {
        return password;
    }

    @Override
    public int compareTo(User o) {
        return Integer.compare(o.score,this.score);
    }


    public void setLocalTime(LocalTime localTime) {
        this.localTime = localTime;
    }


    public void setScore(int score) {
        this.score = score;
    }
}

